package com.example.bdd.demo.enu;

public enum Page {

    index_page(1, "index page"),
    page1(2, "page1"),
    page2(3, "page2"),
        ;

    private final int pageNum;
    private final String pageName;

    Page(int pageNum, String pageName) {
        this.pageNum = pageNum;
        this.pageName = pageName;
    }

    public static int getPageNumByPageName(String pageName) {
        Page[] values = Page.values();
        for (Page v : values) {
            if(v.getPageName().equals(pageName)) {
                return v.getPageNum();
            }
        }
        return -1;
    }

    public int getPageNum() {
        return pageNum;
    }

    public String getPageName() {
        return pageName;
    }

}
